﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Outlook;
using Folder = Toodledo.Model.Folder;

namespace Sync.Outlook
{
    public static class OutlookCategories
    {
        #region Members
        public static IEnumerable<Category> All
        {
            get
            {
                return Local.Categories.Cast<Category>().ToList();
            }
        }
        #endregion

        public static IEnumerable<Category> NonEmptyFolders
        {
            get
            {
                List<Category> nonempties = new List<Category>();
                foreach (Category c in Local.Categories)
                {
                    if(TasksItems.HasTaskWithCategory(c))
                        nonempties.Add(c);
                }
                return nonempties;
            }
        }

        public static void Add(Folder toodledofolder)
        {
            Local.Categories.Add(toodledofolder.Name);
        }
    }
}
